<template>
  <div>
    <!-- top -->
    <van-nav-bar title="标题" left-text="返回" left-arrow>
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
    <!-- mid -->
    <router-view></router-view>
    <!-- bottom -->
    <van-tabbar v-model="active">
      <!-- 通过名称匹配 -->
      <!-- 通过icon修改图标 -->
      <!-- 开启路由模式，点击可以跳转页面 -->
      <van-tabbar-item icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item icon="search">分类</van-tabbar-item>
      <van-tabbar-item icon="friends-o">购物车</van-tabbar-item>
      <van-tabbar-item icon="setting-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import Vue from "vue";
import { NavBar, Tabbar, TabbarItem, Icon } from "vant";
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(NavBar);
Vue.use(Icon);
export default {
  data() {
    return {
      active: 0,
    };
  },
};
</script>

<style>
</style>